<?php
//index.php?act=unsubcribe&module=subscribe_news&email=sdfsad@tet.lt
	if ($act == 'subcribe') {	
		if (!isset($_GET['email'])) $email=NULL; else $email=$_GET['email'];
		if ($email==NULL) if (!isset($_POST['email'])) $email=NULL; else $email=$_POST['email'];
		if ($email==NULL) if (!isset($_GET['subscribe_news_email'])) $email=NULL; else $email=$_GET['subscribe_news_email'];
		if ($email==NULL) if (!isset($_POST['subscribe_news_email'])) $email=NULL; else $email=$_POST['subscribe_news_email'];

		if (isset($email) && (strlen($email) > 0)){
			$res = $subscribe_newsclass->add_new_registation($email);
			if ($res != 1) $err->AddError($res, "subscribe_news");
		} else $err->AddError(13, "subscribe_news");
	} elseif ($act == 'unsubcribe'){
		$w_type = validate_captcha();
		if ($w_type == "") {
			if (!isset($_GET['email'])) $email=NULL; else $email=$_GET['email'];
			if ($email==NULL) if (!isset($_POST['email'])) $email=NULL; else $email=$_POST['email'];
			if (isset($email) && (strlen($email) > 0)){
				$res = $subscribe_newsclass->remove_registation($email);
			} else $err->AddError(13, "subscribe_news");
		}
		
	}
?>
